<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
    <script src="../../../js/jquery/1.x/jquery.js"></script>
    <script src="../../../layui/layui.js" charset="utf-8"></script>
    <script src="../../../js/config.js"></script>
    <script src="../../../js/function.js"></script>
    <script src="../../../js/public.js"></script>
    <link rel="stylesheet" href="../../../css/public.css">
    <link rel="stylesheet" href="../../../css/patient/qss.css">
    <style>
        .switch3 {
            display: inline-block;
            float: right;
        }
        
        .fx-date {
            position: absolute;
            width: 300px!important;
            left: 70px;
        }
        
        .date {
            width: 80px!important;
            text-align: center
        }
        
        .qss-item {
            padding: 5px 15px 5px 30px
        }
        
        .qss-item-title {
            margin-bottom: 0px
        }
        
        .qes_text {
            padding-left: 16px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="tab-title">
            <ul class="tab-title-tab">
                <li>
                    <a href="../V1_1/patient_info.html">
                        <p>基本信息</p>
                        <p class="complete_basic">0%</p>
                    </a>
                </li>
                <li class="tab-curr">
                    <a>
                        <p>病历采集</p>
                        <p class="complete_qss">0%</p>
                    </a>
                </li>
                <li>
                    <a href="./qss7.html">
                        <p>检查信息</p>
                        <p style="display: none;">0%</p>
                    </a>
                </li>
                <div class="clear"></div>
            </ul>
        </div>
        <div class="qss-container">
            <div class="qss-box">
                <div class="qss-box-title">
                    <p>合并症评估</p>
                </div>
                <form class="layui-form qss-form">
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">糖尿病</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">1、您是否患有明确诊断的糖尿病？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="138" id="switch-138" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-138 fx-date opn-138" id="opn-138" style="float:right;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_138" lay-verType="tips" autocomplete="off" readonly="readonly" readonly="readonly" name="13801001" id="fx-13801001"></div>
                                </div>
                            </div>
                        </div>
                        <!--v1.1-->
                        <div class="qss-form-item layui-form-item switch-line opn-138" id="tdx-209" style="display: none">
                            <div class="layui-form-label">2、糖代谢异常类型？</div>
                            <div class="qss-form-item-radio layui-form-item">
                                <input type="radio" title="空腹血糖受损" name="209" class="cv-20901" data-qid="209" value="20901" lay-filter="radio">
                                <input type="radio" title="糖耐量异常" name="209" class="cv-20902" data-qid="209" value="20902" lay-filter="radio">
                                <input type="radio" title="1型糖尿病" name="209" class="cv-20903" data-qid="209" value="20903" lay-filter="radio">
                                <input type="radio" title="2型糖尿病" name="209" class="cv-20904" data-qid="209" value="20904" lay-filter="radio">
                                <input type="radio" title="妊娠期糖尿病" name="209" class="cv-20905" data-qid="209" value="20905" lay-filter="radio">
                                <input type="radio" title="其他特殊类型糖尿病" name="209" class="cv-20906" data-qid="209" value="20906" lay-filter="radio">
                            </div>
                        </div>
                    </div>
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">高血压</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">3、您是否患有明确诊断的高血压？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="139" id="switch-139" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-139 fx-date opn-139" id="opn-139" style="float:none;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_139" lay-verType="tips" autocomplete="off" readonly="readonly" name="13901001" id="fx-13901001"></div>
                                </div>
                            </div>
                        </div>
                        <!--v1.1-->
                        <div class="qss-form-item layui-form-item switch-line opn-139" id="jyy-210" style="display: none">
                            <div class="layui-form-label">4、您在本中心第一次就诊之前是否正在服用降压药？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="210" id="switch-210" title="是|否" option="0|1|2" value=""></div>
                            </div>
                        </div>
                    </div>
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">高血脂症</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">5、您现在或曾经是否患有高血脂?</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="140" id="switch-140" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-140 fx-date opn-140" id="opn-140" style="float:none;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_140" lay-verType="tips" autocomplete="off" readonly="readonly" name="14001001" id="fx-14001001"></div>
                                </div>
                            </div>
                        </div>
                        <!--v1.1-->
                        <div class="qss-form-item layui-form-item switch-line opn-140" id="jzy-211" style="display: none">
                            <div class="layui-form-label">6、您在本中心第一次就诊之前是否正在服用降脂药？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="211" id="switch-211" title="是|否" option="0|1|2" value=""></div>
                            </div>
                        </div>
                    </div>
                    <!--v1.1-->
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">高尿酸血症</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">7、您现在或曾经是否患有高尿酸?</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="212" id="switch-212" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-212 fx-date opn-212" id="opn-212" style="float:none;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_212" lay-verType="tips" autocomplete="off" readonly="readonly" name="21201001" id="fx-21201001"></div>
                                </div>
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line opn-212" id="jns-213" style="display: none">
                            <div class="layui-form-label">8、您在本中心第一次就诊之前是否正在服用降尿酸的药物？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="213" id="switch-213" title="是|否" option="0|1|2" value=""></div>
                            </div>
                        </div>
                    </div>
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">骨质疏松</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">9、您是否患有明确诊断的骨质疏松?</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="141" id="switch-141" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-141 fx-date opn-141" id="opn-141" style="float:none;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_141" lay-verType="tips" autocomplete="off" readonly="readonly" name="14101001" id="fx-14101001"></div>
                                </div>
                            </div>
                        </div>
                        <!--v1.1 移除问题142-->
                        <!--                    <div class="qss-form-item layui-form-item" id="gm-142" style="display: none">-->
                        <!--                        <div class="layui-form-label">5、术前骨密度<input type="text" lay-filter=""  autocomplete="off" name="142" data-qid="142" class="cv-142"></div>-->
                        <!--                    </div>-->
                    </div>
                    <!--v1.1-->
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">冠心病</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">10、您是否患有冠心病？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="214" id="switch-214" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-214 fx-date opn-214" id="opn-214" style="float:right;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_214" lay-verType="tips" autocomplete="off" readonly="readonly" readonly="readonly" name="21401001" id="fx-21401001"></div>
                                </div>
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line opn-214" id="gxb-215" style="display: none">
                            <div class="layui-form-label">11、您的冠心病类型？</div>
                            <div class="qss-form-item-radio layui-form-item">
                                <input type="radio" title="心绞痛型" name="215" class="cv-21501" data-qid="215" value="21501" lay-filter="radio">
                                <input type="radio" title="心肌梗死型" name="215" class="cv-21502" data-qid="215" value="21502" lay-filter="radio">
                                <input type="radio" title="无症状性心肌缺血型" name="215" class="cv-21503" data-qid="215" value="21503" lay-filter="radio">
                                <input type="radio" title="心力衰竭和心律失常型" name="215" class="cv-21504" data-qid="215" value="21504" lay-filter="radio">
                                <input type="radio" title="猝死型" name="215" class="cv-21505" data-qid="215" value="21505" lay-filter="radio">
                                <input type="radio" title="不祥" name="215" class="cv-21506" data-qid="215" value="21506" lay-filter="radio">
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line opn-214" id="gzy-216" style="display: none">
                            <div class="layui-form-label">12、您是否进行了冠状动脉造影？</div>
                            <div class="qss-form-item-radio layui-form-item">
                                <input type="radio" title="是" name="216" class="cv-21601" data-qid="216" value="21601" lay-filter="radio">
                                <input type="radio" title="否" name="216" class="cv-21602" data-qid="216" value="21602" lay-filter="radio">
                                <input type="radio" title="不清楚" name="216" class="cv-21603" data-qid="216" value="21603" lay-filter="radio">
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item opn-214" id="gzl-217" style="display: none">
                            <div class="layui-form-label">13、您是否进行以下治疗(可多选)?</div>
                            <div class="qss-form-item layui-form-item">
                                <div class="qss-form-item-checkbox layui-form-item">
                                    <input type="checkbox" lay-skin="primary" title="溶栓治疗" name="217" class="cv-21701" value="21701" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="介入治疗" name="217" class="cv-21702" value="21702" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="冠脉搭桥术" name="217" class="cv-21703" value="21703" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="药物治疗" name="217" class="cv-21704" value="21704" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="其他" name="217" class="cv-21705" value="21705" data-qid="21705" lay-filter="check1">
                                    <input type="text" style="width:90px;" class="layui-input checkbox-check-input cv-21705001" lay-verify="other_text_less" lay-verType="tips" disabled="disabled" data-qid="21705001">
                                    <input type="checkbox" lay-skin="primary" title="否" name="217" class="cv-21706" value="21706" lay-filter="check1">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">脑卒中（不包括腔隙性脑梗）</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">14、您是否患有脑卒中病史？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="218" id="switch-218" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-218 fx-date opn-218" id="opn-218" style="float:right;display: none">
                                    <div class="layui-form-label">首次发作时间<input type="text" class="date" lay-filter="" lay-verify="date_218" lay-verType="tips" autocomplete="off" readonly="readonly" readonly="readonly" name="21801001" id="fx-21801001"></div>
                                </div>
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item opn-218" id="nzzl-219" style="display: none">
                            <div class="layui-form-label">15、您是否进行以下治疗(可多选)?</div>
                            <div class="qss-form-item layui-form-item">
                                <div class="qss-form-item-checkbox layui-form-item">
                                    <input type="checkbox" lay-skin="primary" title="外科手术" name="219" class="cv-21901" value="21901" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="脑血管成形术(介入治疗)" name="219" class="cv-21902" value="21902" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="溶栓" name="219" class="cv-21903" value="21903" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="药物治疗" name="219" class="cv-21904" value="21904" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="其他" name="219" class="cv-21905" value="21905" data-qid="21905" lay-filter="check1">
                                    <input type="text" style="width:90px;" class="layui-input checkbox-check-input cv-21905001" lay-verify="other_text_less" lay-verType="tips" disabled="disabled" data-qid="21905001">
                                    <input type="checkbox" lay-skin="primary" title="否" name="219" class="cv-21906" value="21906" lay-filter="check1">
                                </div>
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item opn-218" id="nzzd-220" style="display: none">
                            <div class="layui-form-label">16、医生是否告知如下诊断(可多选)?</div>
                            <div class="qss-form-item layui-form-item">
                                <div class="qss-form-item-checkbox layui-form-item">
                                    <input type="checkbox" lay-skin="primary" title="蛛网膜下腔出血" name="220" class="cv-22001" value="22001" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="脑实质出血" name="220" class="cv-22002" value="22002" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="脑梗塞" name="220" class="cv-22003" value="22003" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="脑栓塞" name="220" class="cv-22004" value="22004" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="其它类型脑卒中" name="220" class="cv-22005" value="22005" lay-filter="check1">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">充血性心力衰竭</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">17、您是否患有充血性心力衰竭？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="221" id="switch-221" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-221 fx-date opn-221" id="opn-221" style="float:none;display: none">
                                    <div class="layui-form-label">发作次数<input type="text" style="width: 80px;" class="layui-input checkbox-check-input cv-22101001" lay-verify="date_221" lay-verType="tips" maxlength="2" name="22101001" id="fx-22101001" data-qid="22101001"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">外周动脉疾病</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">18、您是否患有外周动脉疾病？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="222" id="switch-222" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-222 fx-date opn-222" id="opn-222" style="float:none;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_222" lay-verType="tips" autocomplete="off" readonly="readonly" name="22201001" id="fx-22201001"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">肿瘤</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">19、您是否有过肿瘤病史？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="223" id="switch-223" title="是|否" option="0|1|2" value=""></div>
                                <div class="layui-input-inline fx-223 fx-date opn-223" id="opn-223" style="float:none;display: none">
                                    <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter="" lay-verify="date_223" lay-verType="tips" autocomplete="off" readonly="readonly" name="22301001" id="fx-22301001"></div>
                                </div>
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line opn-223" id="zlex-224" style="display: block">
                            <div class="layui-form-label">20、肿瘤性质？</div>
                            <div class="qss-form-item-radio layui-form-item">
                                <input type="radio" title="恶性" name="224" class="cv-22401" data-qid="224" value="22401" lay-filter="radio">
                                <input type="radio" title="良性" name="224" class="cv-22402" data-qid="224" value="22402" lay-filter="radio">
                                <input type="radio" title="不清楚" name="224" class="cv-22403" data-qid="224" value="22403" lay-filter="radio">
                            </div>
                            <div class="qes_text" style="display: none">
                                <input type="text" title="" maxlength="50" name="227" class="cv-227" data-qid="227"  />
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item opn-223" id="zlbw-225" style="display: none">
                            <div class="layui-form-label">21、恶性肿瘤原发部位(可多选)?</div>
                            <div class="qss-form-item layui-form-item">
                                <div class="qss-form-item-checkbox layui-form-item">
                                    <input type="checkbox" lay-skin="primary" title="肝脏" name="225" class="cv-22501" value="22501" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="胰腺" name="225" class="cv-22502" value="22502" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="胃" name="225" class="cv-22503" value="22503" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="结直肠" name="225" class="cv-22504" value="22504" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="乳腺" name="225" class="cv-22505" value="22505" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="宫颈" name="225" class="cv-22506" value="22506" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="卵巢" name="225" class="cv-22507" value="22507" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="子宫内膜" name="225" class="cv-22508" value="22508" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="前列腺" name="225" class="cv-22509" value="22509" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="膀胱" name="225" class="cv-22510" value="22510" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="肾脏" name="225" class="cv-22511" value="22511" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="淋巴瘤" name="225" class="cv-22512" value="22512" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="白血病" name="225" class="cv-22513" value="22513" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="肺部" name="225" class="cv-22514" value="22514" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="甲状腺" name="225" class="cv-22515" value="22515" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="其他" name="225" class="cv-22516" value="22516" data-qid="22516" lay-filter="check1">
                                    <input type="text" style="margin-left:-130px;width:90px;" class="layui-input checkbox-check-input cv-22516001" lay-verify="other_text_less" lay-verType="tips" disabled="disabled" data-qid="22516001">
                                </div>
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item opn-223" id="zlzl-226" style="display: none">
                            <div class="layui-form-label">22、您是否进行以下治疗，选择已做治疗（可多选）</div>
                            <div class="qss-form-item layui-form-item">
                                <div class="qss-form-item-checkbox layui-form-item">
                                    <input type="checkbox" lay-skin="primary" title="手术治疗" name="226" class="cv-22601" value="22601" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="放疗" name="226" class="cv-22602" value="22602" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="化疗" name="226" class="cv-22603" value="22603" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="介入治疗" name="226" class="cv-22604" value="22604" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="其他" name="226" class="cv-22605" value="22605" data-qid="22605" lay-filter="check1">
                                    <input type="text" style="width:90px;" class="layui-input checkbox-check-input cv-22605001" lay-verify="other_text_less" lay-verType="tips" disabled="disabled" data-qid="22605001">
                                    <input type="checkbox" lay-skin="primary" title="否" name="226" class="cv-22606" value="22606" lay-filter="check1">
                                    <input type="checkbox" lay-skin="primary" title="不清楚" name="226" class="cv-22607" value="22607" lay-filter="check1">
                                </div>
                            </div>
                        </div>
                    </div>

                    <!--v1.1 移除-->
                    <!--                <div class="qss-item">-->
                    <!--                    <div class="qss-item-title">-->
                    <!--                        <p style="color:#4777E7;">心脑血管事件</p>-->
                    <!--                    </div>-->
                    <!--                    <div class="qss-form-item layui-form-item">-->
                    <!--                        <div class="layui-form-label">6、有无心脑血管时间发生？</div>-->
                    <!--                        <div class="qss-form-item layui-form-item">-->
                    <!--                            <div class="qss-form-item-checkbox layui-form-item">-->
                    <!--                                <input type="checkbox" lay-skin="primary"  title="脑卒中" name="143" class="cv-14301" value="14301" lay-filter="check1">-->
                    <!--                                <input type="checkbox" lay-skin="primary"  title="冠心病" name="143" class="cv-14302" value="14302" lay-filter="check1">-->
                    <!--                                <input type="checkbox" lay-skin="primary"  title="心力衰竭" name="143" class="cv-14303" value="14303" lay-filter="check1">-->
                    <!--                                <input type="checkbox" lay-skin="primary"  title="其他心脑血管疾病" name="143" class="cv-14304" value="14304" lay-filter="check1">-->
                    <!--                                <input type="text" style="margin-left:-72px;width:90px;" class="layui-input checkbox-check-input cv-14304001" disabled="disabled" data-qid="14304001">-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->
                    <!--                </div>-->
                    <!--                <div class="qss-item">-->
                    <!--                    <div class="qss-item-title">-->
                    <!--                        <p style="color:#4777E7;">恶性肿瘤</p>-->
                    <!--                    </div>-->
                    <!--                    <div class="qss-form-item layui-form-item switch-line">-->
                    <!--                        <div class="layui-form-label">7、有无恶性肿瘤发生？</div>-->
                    <!--                        <div class="layui-input-inline qss-input-swipch">-->
                    <!--                            <div class="switch3" data-qid="144" id="switch-144" title="是|否" option="0|1|2" value=""></div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->
                    <!--                    <div class="qss-form-item layui-form-item fx-144" id="opn-144" style="display:none;">-->
                    <!--                        <div class="layui-form-label">首诊或发现时间</div>-->
                    <!--                        <div class="layui-input-inline layui-form-label" >-->
                    <!--                            <input type="text" class="date" lay-filter=""  autocomplete="off" readonly="readonly" name="145001" id="fx-145001">-->
                    <!--                        </div>-->
                    <!--                        <div class="layui-input-inline">-->
                    <!--                            <div class="layui-form-label">名称</div>-->
                    <!--                            <div class="layui-input-inline" >-->
                    <!--                                <input type="text" class="layui-input cv-145002" lay-filter=""  autocomplete="off" name="145002">-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->
                    <!--                    <div class="qss-form-item layui-form-item fx-144" style="display:none;">-->
                    <!--                        <div class="layui-form-label">首诊或发现时间</div>-->
                    <!--                        <div class="layui-input-inline layui-form-label" >-->
                    <!--                            <input type="text" class="date" lay-filter="" name="145003"  autocomplete="off" readonly="readonly" id="fx-145003">-->
                    <!--                        </div>-->
                    <!--                        <div class="layui-input-inline">-->
                    <!--                            <div class="layui-form-label">名称</div>-->
                    <!--                            <div class="layui-input-inline" >-->
                    <!--                                <input type="text" class="layui-input cv-145004" lay-filter=""  autocomplete="off" name="145004">-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->
                    <!--                    <div class="qss-form-item layui-form-item fx-144" style="display:none;">-->
                    <!--                        <div class="layui-form-label">首诊或发现时间</div>-->
                    <!--                        <div class="layui-input-inline layui-form-label" >-->
                    <!--                            <input type="text" class="date" lay-filter=""  autocomplete="off" readonly="readonly" name="145005" id="fx-145005">-->
                    <!--                        </div>-->
                    <!--                        <div class="layui-input-inline">-->
                    <!--                            <div class="layui-form-label">名称</div>-->
                    <!--                            <div class="layui-input-inline" >-->
                    <!--                                <input type="text" class="layui-input cv-145006" lay-filter=""  autocomplete="off" name="145006">-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->
                    <!--                </div>-->

                    <div class="qss-item">
                        <div class="qss-item-title">
                            <p style="color:#4777E7;">其他疾病史</p>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">23、您是否患有明确诊断的肾脏疾病？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="146" id="switch-146" title="是|否" option="0|1|2" value=""></div>
                                <!--                            <div class="layui-input-inline fx-146 fx-date" style="float:none;display: none">-->
                                <!--                                <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter=""  autocomplete="off" readonly="readonly" name="14601001" id="fx-14601001"></div>-->
                                <!--                            </div>-->
                            </div>
                        </div>
                        <!--v1.1 肾脏疾病时间和名称14601001 14601002-->
                        <div class="qss-form-item layui-form-item fx-146 opn-146" id="opn-146" style="display: none">
                            <div class="layui-form-label">首次诊断时间</div>
                            <div class="layui-input-inline layui-form-label">
                                <input type="text" class="date" lay-filter="" lay-verify="date_146" lay-verType="tips" autocomplete="off" readonly="readonly" name="14601001" id="fx-14601001">
                            </div>
                            <div class="layui-input-inline">
                                <div class="layui-form-label">名称</div>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input cv-14601002" lay-verify="other_text" lay-verType="tips" lay-filter="" autocomplete="off" name="14601002" data-qid="14601002">
                                </div>
                            </div>
                        </div>

                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">24、您是否患有明确诊断的呼吸系统疾病？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="147" id="switch-147" title="是|否" option="0|1|2" value=""></div>
                                <!--                            <div class="layui-input-inline fx-147 fx-date" style="float:none;display: none">-->
                                <!--                                <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter=""  autocomplete="off" readonly="readonly" name="14701001" id="fx-14701001"></div>-->
                                <!--                            </div>-->
                            </div>
                        </div>
                        <!--v1.1 呼吸系统疾病时间和名称14701001 14701002-->
                        <div class="qss-form-item layui-form-item fx-147 opn-147" id="opn-147" style="display: none">
                            <div class="layui-form-label">首次诊断时间</div>
                            <div class="layui-input-inline layui-form-label">
                                <input type="text" class="date" lay-filter="" lay-verify="date_147" lay-verType="tips" autocomplete="off" readonly="readonly" name="14701001" id="fx-14701001">
                            </div>
                            <div class="layui-input-inline">
                                <div class="layui-form-label">名称</div>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input cv-14701002" lay-verify="other_text" lay-verType="tips" lay-filter="" autocomplete="off" name="14701002" data-qid="14701002">
                                </div>
                            </div>
                        </div>

                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">25、您是否患有明确诊断的阻塞性睡眠呼吸暂停低通气综合征（OSAHS）？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="148" id="switch-148" title="是|否" option="0|1|2" value=""></div>
                                <!--                            <div class="layui-input-inline fx-148 fx-date" style="float:none;display: none">-->
                                <!--                                <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter=""  autocomplete="off" readonly="readonly" name="14801001" id="fx-14801001"></div>-->
                                <!--                            </div>-->
                            </div>
                        </div>
                        <!--v1.1 OSAHS时间和名称14801001 14801002-->
                        <div class="qss-form-item layui-form-item fx-148 opn-148" id="opn-148" style="display: none">
                            <div class="layui-form-label">首次诊断时间</div>
                            <div class="layui-input-inline layui-form-label">
                                <input type="text" class="date" lay-filter="" lay-verify="date_148" lay-verType="tips" autocomplete="off" readonly="readonly" name="14801001" id="fx-14801001">
                            </div>
                            <div class="layui-input-inline">
                                <div class="layui-form-label">名称</div>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input cv-14801002" lay-verify="other_text" lay-verType="tips" lay-filter="" autocomplete="off" name="14801002" data-qid="14801002">
                                </div>
                            </div>
                        </div>

                        <div class="qss-form-item layui-form-item switch-line opn-148" id="os-148" style="display: none">
                            <div class="layui-form-label">26、如有OSAHS，程度怎样？</div>
                            <div class="qss-form-item-radio layui-form-item">
                                <input type="radio" title="轻" name="149" class="cv-14901" data-qid="149" value="14901" lay-filter="radio">
                                <input type="radio" title="中" name="149" class="cv-14902" data-qid="149" value="14902" lay-filter="radio">
                                <input type="radio" title="重" name="149" class="cv-14903" data-qid="149" value="14903" lay-filter="radio">
                            </div>
                        </div>
                        <div class="qss-form-item layui-form-item switch-line">
                            <div class="layui-form-label">27、您是否患有明确诊断的肝脏疾病？</div>
                            <div class="layui-input-inline qss-input-swipch">
                                <div class="switch3" data-qid="150" id="switch-150" title="是|否" option="0|1|2" value=""></div>
                                <!--                            <div class="layui-input-inline fx-150 fx-date" style="float:none;display: none">-->
                                <!--                                <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter=""  autocomplete="off" readonly="readonly" name="15001001" id="fx-15001001"></div>-->
                                <!--                            </div>-->
                            </div>
                        </div>
                        <!--v1.1 肝脏疾病时间和名称15001001 15001002-->
                        <div class="qss-form-item layui-form-item fx-150 opn-150" id="opn-150" style="display: none">
                            <div class="layui-form-label">首次诊断时间</div>
                            <div class="layui-input-inline layui-form-label">
                                <input type="text" class="date" lay-filter="" lay-verify="date_150" lay-verType="tips" autocomplete="off" readonly="readonly" name="15001001" id="fx-15001001">
                            </div>
                            <div class="layui-input-inline">
                                <div class="layui-form-label">名称</div>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input cv-15001002" lay-verify="other_text" lay-verType="tips" lay-filter="" autocomplete="off" name="15001002" data-qid="15001002">
                                </div>
                            </div>
                        </div>

                        <!--<div class="qss-form-item layui-form-item switch-line">
                        <div class="layui-form-label">13、您是否患有明确诊断的感染性疾病？</div>
                        <div class="layui-input-inline qss-input-swipch">
                            <div class="switch3" data-qid="151" id="switch-151" title="是|否" option="0|1|2" value=""></div>
                            <div class="layui-input-inline fx-151 fx-date" style="float:none;display: none">
                                <div class="layui-form-label">首次诊断时间<input type="text" class="date" lay-filter=""  autocomplete="off" readonly="readonly" name="15101001" id="fx-15101001"></div>
                            </div>
                        </div>
                    </div>-->
                    </div>

                    <div class="qss-item-btn">
                        <div class="qss-item-btn">
                            <a href="javascript:;">
                                <button type="button" lay-submit="" lay-filter="submit-btn" data-type="1">提交并跳转下一页</button>
                            </a>
                            <a href="javascript:;">
                                <button type="button" lay-submit="" lay-filter="submit-btn" data-type="0">保存并留在本页</button>
                            </a>
                            <a href="qss5.html">
                                <button type="button">放弃编辑并跳转下一页</button>
                            </a>
                        </div>
                    </div>
                </form>
                <div class="fixed-nav">
                    <ul>
                        <li><a href="./qss1.html"><span>个人疾病史</span><span class="complete_qss1"></span><div class="clear"></div></a></li>
                        <li><a href="./qss2.html"><span>垂体疾病评估</span><span class="complete_qss2"></span><div class="clear"></div></a></li>
                        <li><a href="./qss3.html"><span>垂体疾病用药</span><span class="complete_qss3"></span><div class="clear"></div></a></li>
                        <li class="fixed-nav-curr"><a><span>合并症评估</span><span class="complete_qss4"></span><div class="clear"></div></a></li>
                        <li><a href="./qss5.html"><span>合并症用药</span><span class="complete_qss5"></span><div class="clear"></div></a></li>
                        <li><a href="./qss6.html"><span>垂体疾病治疗</span><span class="complete_qss6"></span><div class="clear"></div></a></li>
                    </ul>

                    <button type="button" lay-submit="" lay-filter="submit-btn" data-type="1">提交</button>
                </div>
            </div>
        </div>
    </div>
</body>
<script>
    var question = {
        138: [0, '', 's1'], //是否患有明确诊断的糖尿病
        139: [0, '', 's1'], //是否换有明确诊断的高血压
        140: [0, '', 's1'], //是否换有明确诊断的高血脂症
        141: [0, '', 's1'], //是否换有明确诊断的骨质疏松
        //143:[13802,'否','s1'],//有无心脑血管事件发生
        144: [0, '', 's1'], //有无恶性肿瘤发生
        146: [0, '', 's1'], //是否患有明确诊断的慢性肾脏疾病
        147: [0, '', 's1'], //是否患有明确诊断的呼吸系统疾病
        148: [0, '', 's1'], //是否患有明确诊断的阻塞性呼吸暂停低通气综合征(OSAHS)
        149: [0, '', 's1'], //OSAHS，程度怎样
        150: [0, '', 's1'], //是否患有明确诊断的慢性肝脏疾病
        151: [0, '', 's1'], //是否患有明确诊断的感染性疾病
        //v1.1
        209: [0, '', 's1'], //糖代谢异常类型
        210: [21002, '否', 's1'], //是否正在服用降压药
        211: [21102, '否', 's1'], //是否正在服用降脂药
        212: [0, '', 's1'], //是否患有明确诊断的高尿酸血症
        213: [21302, '否', 's1'], //是否正在服用降尿酸药物
        214: [0, '', 's1'], //您是否患有冠心病
        215: [0, '', 's1'], //您的冠心病类型
        216: [0, '', 's1'], //您是否进行了冠状动脉造影
        217: [0, '', 's1'], //您是否进行以下治疗
        218: [0, '', 's1'], //您是否患有脑卒中病史
        219: [0, '', 's1'], //您是否进行以下治疗
        220: [0, '', 's1'], //医生是否告知如下诊断
        221: [0, '', 's1'], //您是否患有充血性心力衰竭
        222: [0, '', 's1'], //您是否患有外周动脉疾病
        223: [0, '', 's1'], //您是否有过肿瘤病史
        224: [0, '', 's1'], //该肿瘤是否为恶性
        225: [0, '', 's1'], //恶性肿瘤原发部位
        226: [0, '', 's1'], //您是否进行以下治疗

        check_list: {},
        time_list: {},
        input_list: {}
    }

    var arr1 = [138, 139, 140, 141, 146, 147, 148, 150, 151, 212, 214, 218, 221, 222, 223]; //开关带选项
    var arr2 = [210, 211, 213]; //开关
    var arr3 = [209, 215, 216, 224, 149]; //单选
    var arr4 = [217, 219, 220, 225, 226]; //复选
    var arr5 = [13801001, 13901001, 14001001, 14101001, 14601001, 14701001, 14801001, 15001001, 21401001, 21801001, 21201001, 22201001, 22301001]; //时间输入
    var arr6 = [14601002, 14701002, 14801002, 15001002, 21705001, 21905001, 22101001, 22516001, 22605001,227]; //文本输入
    var arr7 = [21705, 21905, 22516, 22605]; // 答案是复选带文本框



    function initForm(patient_id, callback) {
        ajax_get(configUrl.qssInfo, {
            user_id: patient_id,
            visit_level: 1,
            template_id: 14
        }, (res) => {
            console.log(res.data.question_data)
                // var arr1 = [138,139,140,141,144,146,147,148,150,151];
                //v1.1
            $.each(res.data.question_data, function(index, item) {
                var qid = parseInt(item.question_id);
                if(qid==227&&item.answer.length > 0){
                    if(item.answer[0].answer_value){
                        $('.qes_text').show();
                       $('.cv-227').attr('value', item.answer[0].answer_value); 
                    }
                }                //v1.1 开关带选项&开关
                if (arr1.includes(qid) || arr2.includes(qid)) {
                    if (item.subquestion_id.length == 3) {
                        if (item.answer.length > 0) {
                            if (item.answer[0].answer_id == (qid + '01')) { //选中
                                $("input[name='q" + qid + "']").attr('checked', true);
                                $("#switch-" + qid).attr('value', 1);
                                // $(".fx-" + qid).show();
                                // if (qid == 141) {
                                //     $("#gm-142").show()
                                // }
                                // if (qid == 148) {
                                //     $('#os-148').show();
                                // }

                                //v1.1 显示子问题
                                if (arr1.includes(qid)) {
                                    $(".opn-" + qid).show();
                                }
                            } else {
                                $("#switch-" + qid).attr('value', 2);
                                $("input[name='q" + qid + "']").attr('checked', false);
                                // $(".fx-" + qid).hide();
                                // if (qid == 141) {
                                //     $("#gm-142").hide()
                                // }
                                // if (qid == 148) {
                                //     $('#os-148').hide();
                                // }

                                //v1.1 隐藏子问题
                                if (arr1.includes(qid)) {
                                    $(".opn-" + qid).hide();
                                }
                            }
                            question[qid][0] = item.answer[0].answer_id;
                            question[qid][1] = item.answer[0].answer_value;
                        }
                    }
                }
                //v1.1 单选
                if (arr3.includes(qid)) {
                    if (item.answer.length > 0) {
                        $(".cv-" + item.answer[0].answer_id).attr('checked', true);
                        question[qid][0] = item.answer[0].answer_id;
                        question[qid][1] = item.answer[0].answer_value;
                    }
                }
                //v1.1 复选
                if (arr4.includes(qid)) {
                    $.each(item.answer, function(index, item2) {
                        // 复选输入框
                        if (item.subquestion_id.length == 8) {
                            $(".cv-" + item2.answer_id).val(item.answer[0].answer_value);
                        } else {
                            $(".cv-" + item2.answer_id).attr('checked', true);
                            if (arr7.includes(item2.answer_id)) {
                                $(".cv-" + item2.answer_id).prop('disabled', false);
                            } else {
                                // $(".cv-" + item2.answer_id).val('');
                            }
                            question['check_list'][item2.answer_id] = item2.answer_value;
                        }
                    })
                }
                //v1.1 时间
                if (arr5.includes(parseInt(item.subquestion_id))) {
                    if (item.answer.length > 0) {
                        // $("input[name='"+ item.subquestion_id + "']").val(item.answer[0].answer_value);
                        $("#fx-" + item.answer[0].answer_id).val(item.answer[0].answer_value);
                        question.time_list[item.answer[0].answer_id] = item.answer[0].answer_value;
                    }
                }
                //v1.1 文本
                if (arr6.includes(parseInt(item.subquestion_id))) {
                    if (item.answer.length > 0) {
                        // $("input[name='"+ item.subquestion_id + "']").val(item.answer[0].answer_value);
                        $(".cv-" + item.answer[0].answer_id).val(item.answer[0].answer_value);
                        question.input_list[item.answer[0].answer_id] = item.answer[0].answer_value;
                    }
                }

                // if (qid == 145) {
                //     if (item.answer.length > 0) {
                //         if (item.answer[0].answer_id == 145001 || item.answer[0].answer_id == 145003 ||item.answer[0].answer_id == 145005) {
                //             $("input[name='"+ item.subquestion_id + "']").val(item.answer[0].answer_value);
                //             question.time_list[item.answer[0].answer_id] = item.answer[0].answer_value;
                //         } else {
                //             $("input[name='"+ item.subquestion_id + "']").val(item.answer[0].answer_value);
                //         }
                //
                //     }
                // }
                // if (qid == 142) {
                //     if (item.answer.length > 0) {
                //         $("input[name='"+ item.subquestion_id + "']").val(item.answer[0].answer_value);
                //         question.input_list[item.answer[0].answer_id] = item.answer[0].answer_value;
                //     }
                // }

                // if (qid == 143) {
                //     $.each(item.answer,function (index,item2) {
                //         if (item.subquestion_id == 14304001) {
                //             $('.cv-14304001').val(item.answer[0].answer_value);
                //         } else {
                //             $(".cv-" + item2.answer_id).attr('checked',true);
                //             if (item2.answer_id == 14304) {
                //                 $('.cv-14304001').prop('disabled',false);
                //             } else {
                //                 $('.cv-14304001').val('');
                //             }
                //             question['check_list'][item2.answer_id] = item2.answer_value;
                //         }
                //     })
                // }
                // if (qid == 149) {
                //     if (item.answer.length > 0) {
                //         $(".cv-"+ item.answer[0].answer_id).attr('checked',true);
                //         question[qid][0] = item.answer[0].answer_id;
                //         question[qid][1] = item.answer[0].answer_value;
                //     }
                // }
            })
            callback();
        })
    }
    $(document).ready(function() {
        var height = $(window).height() - 2;
        //$('.container').height(height);
        var patient_id = getLocalStorage('patient_id');



        //完整度
        getCompletion();

        layui.config({
            base: '../../../layui/layui_exts/'
        }).extend({
            switch3: 'switch3/switch3'
        }).use(['element', 'form', 'layer', 'laydate', 'laypage', 'switch3'], function() {
            var element = layui.element;
            var form = layui.form;
            var layer = layui.layer;
            var laydate = layui.laydate;
            var laypage = layui.laypage,
                switch3 = layui.switch3;


            initForm(patient_id, function() {
                switch3.render({
                    elem: '.switch3',
                    done: function(val, item) {
                        var qid = item.parent().parent().attr('data-qid');
                        if (val == 0) {
                            question[qid][0] = 0;
                            question[qid][1] = '';
                            $(".opn-" + qid).hide(); // v1.1
                            // $("#opn-"+qid).hide();
                            // $(".fx-"+qid).hide();
                            $("#fx-" + qid + '01001').val('');
                            delete question.time_list[qid + '01001'];
                            if (qid == 221) {
                                delete question.input_list[qid + '01001'];
                            }

                            //v1.1
                            var arr8 = [138, 139, 140, 146, 147, 148, 150, 212, 214, 218, 223]; //开关带子问题
                            if (qid == 138) {
                                $('.cv-20901').attr('checked', false);
                                $('.cv-20902').attr('checked', false);
                                $('.cv-20903').attr('checked', false);
                                $('.cv-20904').attr('checked', false);
                                $('.cv-20905').attr('checked', false);
                                $('.cv-20906').attr('checked', false);
                                delete question.check_list[20901];
                                delete question.check_list[20902];
                                delete question.check_list[20903];
                                delete question.check_list[20904];
                                delete question.check_list[20905];
                                delete question.check_list[20906];
                            }
                            if (qid == 139) {
                                $('.switch-210').attr('checked', false);;
                                delete question.check_list[210];
                            }

                            // if (qid == 141) {
                            //     $('#gm-142').hide();
                            //     $('.cv-142').val('');
                            // }
                            // if (qid == 148) {
                            //     $('#os-148').hide();
                            // }
                            // if (qid == 144) {
                            //     $("#fx-145001").val('');
                            //     $("#fx-145003").val('');
                            //     $("#fx-145005").val('');
                            //     $(".cv-145002").val('');
                            //     $(".cv-145004").val('');
                            //     $(".cv-145006").val('');
                            //     delete question.time_list['145001'];
                            //     delete question.time_list['145003'];
                            //     delete question.time_list['145005'];
                            // }
                        } else if (val == 1) {
                            question[qid][0] = qid + '01';
                            question[qid][1] = item.html();
                            $(".opn-" + qid).show(); // v1.1
                            // $("#opn-"+qid).show();
                            // $(".fx-"+qid).show();
                            // if (qid == 141) {
                            //     $('#gm-142').show();
                            // }
                            // if (qid == 148) {
                            //     $('#os-148').show();
                            // }
                        } else if (val == 2) {
                            question[qid][0] = qid + '02';
                            question[qid][1] = item.html();
                            $(".opn-" + qid).hide(); // v1.1
                            // $("#opn-"+qid).hide();
                            // $(".fx-"+qid).hide();
                            $("#fx-" + qid + '01001').val('');
                            delete question.time_list[qid + '01001'];
                            if (qid == 221) {
                                delete question.input_list[qid + '01001'];
                            }

                            //v1.1
                            var arr8 = [138, 139, 140, 146, 147, 148, 150, 212, 214, 218, 223]; //开关带子问题
                            if (qid == 138) {
                                $('.cv-20901').attr('checked', false);
                                $('.cv-20902').attr('checked', false);
                                $('.cv-20903').attr('checked', false);
                                $('.cv-20904').attr('checked', false);
                                $('.cv-20905').attr('checked', false);
                                $('.cv-20906').attr('checked', false);
                            }
                            if (qid == 139) {
                                $('.switch-210').attr('checked', false);;
                            }
                            // if (qid == 141) {
                            //     $('#gm-142').hide();
                            //     $('.cv-142').val('');
                            // }
                            // if (qid == 148) {
                            //     $('#os-148').hide();
                            // }
                            // if (qid == 144) {
                            //     $("#fx-145001").val('');
                            //     $("#fx-145003").val('');
                            //     $("#fx-145005").val('');
                            //     $(".cv-145002").val('');
                            //     $(".cv-145004").val('');
                            //     $(".cv-145006").val('');
                            //     delete question.time_list['145001'];
                            //     delete question.time_list['145003'];
                            //     delete question.time_list['145005'];
                            // }
                        }
                    }
                });
                form.render();
            });

            var fx_date = document.getElementsByClassName('date');
            $.each(fx_date, function(index, item) {
                    laydate.render({
                        elem: item,
                        type: 'month',
                        max: 0,
                        value: '',
                        trigger: 'click', //添加这一行来处理
                        isInitValue: true,
                        change: function(value, date, endDate) {
                            if ($(".layui-laydate").length) {
                                $(item).val(value);
                                $(".layui-laydate").remove();
                            }
                            question.time_list[item.name] = value;//gao新加
                        }/*,
                        done: function(value, date, endDate) {
                            question.time_list[item.name] = value;
                        }*/

                    });
                })
                //开关切换
                /*form.on('switch(switch1)',function (data) {
                    var qid = $(this).attr('data-qid');
                    if (this.checked) {
                        question[qid][0] = qid + '01';
                        question[qid][1] = '是';
                        $(".fx-" + qid).show();
                    } else {
                        question[qid][0] = qid + '02';
                        question[qid][1] = '否';
                        $(".fx-" + qid).hide();
                        delete question.time_list[qid + '01001'];
                        if (qid == 144) {
                            delete question.time_list['145001'];
                            delete question.time_list['145003'];
                            delete question.time_list['145005'];
                        }
                    }
                })*/
                //单选框切换
            form.on('radio(radio)', function(data) {
                console.log(data, '9999')
                var qid = $(this).attr('data-qid');
                if (data.value == '22401' || data.value == '22402') {
                    
                    $('.qes_text').show()
                }
                if (data.value == '22403') {
                    $(".cv-227").val('');
                    $('.qes_text').hide()
                }
                if (data.elem.checked) {
                    question[qid][0] = data.value;
                    question[qid][1] = $(this).attr('title');
                } else {
                    question[qid][0] = 0;
                    question[qid][1] = '';
                }
            })

            //复选框切换
            form.on('checkbox(check1)', function(data) {
                var qid = parseInt(data.value);
                // var qid = parseInt($(this).attr('data-qid'));
                var val = $(this).attr('title');

                if (this.checked) {
                    if (arr7.includes(qid)) {
                        $(".cv-" + qid + "001").prop('disabled', false);
                    }
                    question.check_list[qid] = val;
                } else {
                    if (arr7.includes(qid)) {
                        $(".cv-" + qid + "001").prop('disabled', true);
                        $(".cv-" + qid + "001").val('');
                    }
                    delete question.check_list[qid];
                }
            })

            // v1.1 信息校验
            form.verify({
                other_text: function(value) {
                    if (value.length > 20) {
                        return '输入内容不能超过20个字';
                    }
                },
                other_text_less: function(value) {
                    if (value.length > 10) {
                        return '输入内容不能超过10个字';
                    }
                },
                other_text_mini: function(value) {
                    if (parseInt(value) >= 100) {
                        return '只能输入2位数字';
                    }
                    if (parseInt(value) < 0) {
                        return '只能输入正数';
                    }
                },
                date_138: function(value) {
                    if ($("#switch-138").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_139: function(value) {
                    if ($("#switch-139").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_140: function(value) {
                    if ($("#switch-140").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_212: function(value) {
                    if ($("#switch-212").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_141: function(value) {
                    if ($("#switch-141").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_214: function(value) {
                    if ($("#switch-214").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_218: function(value) {
                    if ($("#switch-218").val() == 1 && value.length == 0) {
                        return '请输入首次发作时间';
                    }
                },
                date_221: function(value) {
                    if ($("#switch-221").val() == 1 && value.length == 0) {
                        return '请输入发作次数';
                    }
                    if (!new RegExp("(^$)|^(?!(0[0-9]{0,}$))[0-9]{1,}[.]{0,}[0-9]{0,}$").test(value)) {
                        return '只能输入数字';
                    }
                    if (parseInt(value) > 99) {
                        return '只能输入2位数字';
                    }
                },
                date_222: function(value) {
                    if ($("#switch-222").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_223: function(value) {
                    if ($("#switch-223").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_146: function(value) {
                    if ($("#switch-146").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_147: function(value) {
                    if ($("#switch-147").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_148: function(value) {
                    if ($("#switch-148").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
                date_150: function(value) {
                    if ($("#switch-150").val() == 1 && value.length == 0) {
                        return '请输入诊断时间';
                    }
                },
            });

            form.on('submit(submit-btn)', function() {
                var isSubmit = 1;
                // question.input_list[142] = $('.cv-142').val();
                // question.input_list[14304001] = $('.cv-14304001').val();
                // if (question[144][0] == 14401) {
                //     question.input_list[145002] = $('.cv-145002').val();
                //     question.input_list[145004] = $('.cv-145004').val();
                //     question.input_list[145006] = $('.cv-145006').val();
                // }
                // question.input_list[14601002] = $('.cv-14601002').val();
                // question.input_list[14701002] = $('.cv-14701002').val();
                // question.input_list[14801002] = $('.cv-14801002').val();
                // question.input_list[15001002] = $('.cv-15001002').val();
                // question.input_list[21705001] = $('.cv-21705001').val();
                // question.input_list[21905001] = $('.cv-21905001').val();
                // question.input_list[22101001] = $('.cv-22101001').val();
                // question.input_list[22516001] = $('.cv-22516001').val();
                // question.input_list[22605001] = $('.cv-22605001').val();

                var chapterId = 1401;
                var visitLevel = 1;
                var params = {
                    'hosp_id': getLocalStorage('hosp_id'),
                    'dept_id': getLocalStorage('dept_id'),
                    'user_id': getLocalStorage('patient_id'),
                    'doc_id': getLocalStorage('doc_id'),
                    'visit_level': 1,
                    'template_id': 14,
                    'terminal_flg': 0,
                    'data': [{
                        'visit_level': 1,
                        'user_id': getLocalStorage('patient_id'),
                        'doc_id': getLocalStorage('doc_id'),
                        "terminal_flg": "0",
                        'template_id': 14,
                        "datasource": "2",
                        'answer': []
                    }]
                };
                var answer = [];

                // v1.1 只有是否的切换遍历 （包含单选）
                $.each(question, function(qid, item) {
                    if (item[2] == 's1') {
                        if (question[qid][0] != 0) {
                            answer.unshift({
                                'chapter_id': chapterId,
                                'question_id': qid,
                                'subquestion_id': qid,
                                'answer_id': question[qid][0],
                                'answer_name': question[qid][1],
                                'visit_level': visitLevel
                            });
                        }
                    }
                });

                // v1.1 多选
                $.each(question.check_list, function(qid2, item) {
                    qid = parseInt(parseInt(qid2) / 100);
                    //console.log('checkbox',item);
                    answer.push({
                        'chapter_id': chapterId,
                        'question_id': qid,
                        'subquestion_id': qid,
                        'answer_id': qid2,
                        'answer_name': item,
                        'visit_level': visitLevel
                    });
                })

                //只有切换
                // $.each(question,function (qid,item) {
                //     var qidArr = [138,139,140,141,146,147,148,150,151];
                //     if (item[2] == 's1') {
                //         if (qidArr.includes(parseInt(qid))) {
                //             if (item[0] == qid+'01') {
                //                 if ($('#fx-' + qid + '01001').val() == '') {
                //                     isSubmit = 0;
                //                     layer.msg('请选择时间');
                //                     $('#fx-' + qid + '01001').css('border-color','red');
                //                     return false
                //                 }
                //                 if (qid == 141) {
                //                     if ($('.cv-142').val() == '') {
                //                         isSubmit = 0;
                //                         layer.msg('请输入术前骨密度');
                //                         $('.cv-142').css('border-color','red');
                //                         return false
                //                     }
                //                 }
                //             }
                //         }
                //         if (qid == 144) {
                //             if (item[0] == qid + '01') {
                //                 if ($('#fx-145001').val() == '') {
                //                     isSubmit = 0;
                //                     layer.msg('请选择时间');
                //                     $('#fx-145001').css('border-color','red');
                //                     return false
                //                 }
                //                 if ($('.cv-145002').val() == '') {
                //                     isSubmit = 0;
                //                     layer.msg('请选择时间');
                //                     $('.cv-145002').css('border-color','red');
                //                     return false
                //                 }
                //             }
                //         }
                //         if(question[qid][0] != 0) {
                //             answer.unshift({
                //                 'chapter_id': chapterId,
                //                 'question_id': qid,
                //                 'subquestion_id': qid,
                //                 'answer_id': question[qid][0],
                //                 'answer_name': question[qid][1],
                //                 'visit_level': visitLevel
                //             });
                //         }
                //     }
                // });
                // if (isSubmit == 0) {
                //     console.log('a');
                //     return false;
                // }
                //复选框
                // $.each(question.check_list,function (qid2,item) {
                //     if (qid2 == 14304) {
                //         if ($('.cv-14304001').val() == '') {
                //             isSubmit = 0;
                //             layer.msg('请填写其他心脑血管疾病');
                //             $('.cv-14304001').css('border-color','red');
                //             return false
                //         }
                //     }
                //     var qid = parseInt(parseInt(qid2)/100);
                //     answer.push({
                //         'chapter_id':chapterId,
                //         'question_id':qid,
                //         'subquestion_id':qid,
                //         'answer_id':qid2,
                //         'answer_name':item,
                //         'visit_level':visitLevel
                //     });
                // });
                // if (isSubmit == 0) {
                //     console.log('a');
                //     return false;
                // }
                //时间
                $.each(question.time_list, function(qid3, item) {
                    if (qid3.length == 8) {
                        var qid = parseInt(parseInt(qid3) / 100000);
                    } else if (qid3.length == 6) {
                        var qid = parseInt(parseInt(qid3) / 1000);
                    } else {
                        var qid = qid3;
                    }
                    answer.push({
                        'chapter_id': chapterId,
                        'question_id': qid,
                        'subquestion_id': qid3,
                        'answer_id': qid3,
                        'answer_name': item,
                        'visit_level': visitLevel
                    });
                });
            
                

                // 文本输入
                delete question.input_list;
                question.input_list = {};
                question['input_list'][$(".cv-21705001").attr('data-qid')] = $(".cv-21705001").val();
                question['input_list'][$(".cv-21905001").attr('data-qid')] = $(".cv-21905001").val();
                question['input_list'][$(".cv-22101001").attr('data-qid')] = $(".cv-22101001").val();
                question['input_list'][$(".cv-22516001").attr('data-qid')] = $(".cv-22516001").val();
                question['input_list'][$(".cv-22605001").attr('data-qid')] = $(".cv-22605001").val();
                question['input_list'][$(".cv-14601002").attr('data-qid')] = $(".cv-14601002").val();
                question['input_list'][$(".cv-14701002").attr('data-qid')] = $(".cv-14701002").val();
                question['input_list'][$(".cv-14801002").attr('data-qid')] = $(".cv-14801002").val();
                question['input_list'][$(".cv-15001002").attr('data-qid')] = $(".cv-15001002").val();
                question['input_list'][$(".cv-227").attr('data-qid')] = $(".cv-227").val();


                //输入框
                $.each(question.input_list, function(qid4, item) {
                    if (qid4.length == 8) {
                        var qid = parseInt(parseInt(qid4) / 100000);
                    } else if (qid4.length == 6) {
                        var qid = parseInt(parseInt(qid4) / 1000);
                    } else {
                        var qid = qid4;
                    }
                    answer.push({
                        'chapter_id': chapterId,
                        'question_id': qid,
                        'subquestion_id': qid4,
                        'answer_id': qid4,
                        'answer_name': item,
                        'visit_level': visitLevel
                    });
                });
                // if(answer.length == 0){
                //     layer.msg('没有选择项，请直接跳过');
                //     return false;
                // }
                params.data[0].answer = answer;
                var jumpType = $(this).attr('data-type')
                ajax_post(configUrl.qssInfo, params, function(res) {
                    if (res.status == '0') {
                        layer.msg('操作成功', {
                            icon: 6,
                            time: 1000
                        }, function() {
                            if (jumpType == 0) {
                                //不跳转
                                window.location.reload();
                            } else {
                                //跳转
                                window.location.href = 'qss5.html';
                            }
                        });
                    } else {
                        layer.msg(res.msg, {
                            icon: 5
                        });
                    }
                })
                return false;
            })
        })
    })
</script>

</html>